home *** CD-ROM | disk | FTP | other *** search
Wrap
ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeee((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeee((((3333xxxx)))) NNNNAAAAMMMMEEEE cpusetGetName - get the name of the cpuset to which a process is attached SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>> ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt ****ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeee((((ppppiiiidddd____tttt ppppiiiidddd))));;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The _c_p_u_s_e_t_G_e_t_N_a_m_e function is used to obtain the name of the cpuset to which the specified process has been attached. The ppppiiiidddd argument specifies the process ID. Currently, the only valid value for ppppiiiidddd is 0, which returns the name of the cpuset to which the current process is attached. The function returns a pointer to a structure of type ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt (defined in <cpuset.h>). The function _c_p_u_s_e_t_G_e_t_N_a_m_e allocates the memory for the structure and all of its associated data. The user is responsible for freeing the memory using the function _c_p_u_s_e_t_F_r_e_e_N_a_m_e_L_i_s_t(3x). The ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure is defined as follows: typedef struct { int count; char **list; int *status; } cpuset_NameList_t; ccccoooouuuunnnntttt is the number of cpuset names in the list. In the case of _c_p_u_s_e_t_G_e_t_N_a_m_e this member will should only contain the values of 0 and 1. lllliiiisssstttt references the list of names. ssssttttaaaattttuuuussss is a list of status flags that indicate the status of the corresponding cpuset name in lllliiiisssstttt. The following flag values may be used: _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______QQQQ_UUUU_EEEE_UUUU_EEEE______NNNN_AAAA_MMMM_EEEE Indicates that the corresponding name in lllliiiisssstttt is the name of a cpuset queue. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______CCCC_PPPP_UUUU______NNNN_AAAA_MMMM_EEEE Indicates that the corresponding name in lllliiiisssstttt is the CPU ID for a restricted CPU. The memory for lllliiiisssstttt and ssssttttaaaattttuuuussss is allocated when the ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt is allocated and it is released when the ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure is released. PPPPaaaaggggeeee 1111 ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeee((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeee((((3333xxxx)))) EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS This example obtains cpuset name or CPU ID to which the current process is attached: cpuset_NameList_t *name; /* Get the name else print error & exit */ if ( !(name = cpusetGetName(0)) ) { perror("cpusetGetName"); exit(1); } if (name->count == 0) { printf("Current process not attached\n"); } else { if (name->status[0] == CPUSET_CPU_NAME) { printf("Current process attached to" " CPU_ID[%s]\n", name->list[0]); } else { printf("Current process attached to" " CPUSET[%s]\n", name->list[0]); } } cpusetFreeNameList(name); NNNNOOOOTTTTEEEESSSS _c_p_u_s_e_t_G_e_t_N_a_m_e is found in the library "libcpuset.so", and will be loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1). SSSSEEEEEEEE AAAALLLLSSSSOOOO cpuset(1), cpusetFreeNameList(3x), cpusetGetNameList(3x), cpuset(5). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS If successful, _c_p_u_s_e_t_G_e_t_N_a_m_e returns a pointer to a ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure. If _c_p_u_s_e_t_G_e_t_N_a_m_e fails, it returns NULL and eeeerrrrrrrrnnnnoooo is set to indicate the error. The possible values for eeeerrrrrrrrnnnnoooo include those values as set by _s_y_s_m_p(2), _s_b_r_k(2), and the following: EEEEIIIINNNNVVVVAAAALLLL Invalid value for _pppp_iiii_dddd was supplied. Currenlty only 0 is accepted to obtain the cpuset name that the current process is attached to. EEEERRRRAAAANNNNGGGGEEEE Number of CPUs configured on the system is not a value greater than or equal to 1. PPPPaaaaggggeeee 2222